<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ClaraGenomicsAnalysis: cudamapper/include/claragenomics/cudamapper/index.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ClaraGenomicsAnalysis
   &#160;<span id="projectnumber">0.4.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_2312589fb962dec58b1579fafe6a300a.html">cudamapper</a></li><li class="navelem"><a class="el" href="dir_46ada5e69ffe047ce1b425fcb02bc946.html">include</a></li><li class="navelem"><a class="el" href="dir_00faf102fbd78ece25aa2d8f2597f59b.html">claragenomics</a></li><li class="navelem"><a class="el" href="dir_5d9177f36fbce0c085b11d352d248d8a.html">cudamapper</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">index.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">* Copyright (c) 2019, NVIDIA CORPORATION.  All rights reserved.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">*</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">* NVIDIA CORPORATION and its licensors retain all intellectual property</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">* and proprietary rights in and to this software, related documentation</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">* and any modifications thereto.  Any use, reproduction, disclosure or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">* distribution of this software and related documentation without an express</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">* license agreement from NVIDIA CORPORATION is strictly prohibited.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;claragenomics/cudamapper/sketch_element.hpp&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;claragenomics/cudamapper/types.hpp&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;claragenomics/io/fasta_parser.hpp&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;thrust/device_vector.h&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">namespace </span>claragenomics</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;{</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">namespace </span>cudamapper</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;{</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classclaragenomics_1_1cudamapper_1_1Index.html">   31</a></span>&#160;<span class="keyword">class </span><a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html">Index</a></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;{</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    <span class="keyword">virtual</span> <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#afcaccc9f9526d9c66280eca17ff3a4ac">~Index</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> thrust::device_vector&lt;representation_t&gt;&amp; <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#a876d5e82f9fc36f481854f7d84e5fc80">representations</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> thrust::device_vector&lt;read_id_t&gt;&amp; <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#a5cfe03b47850170ec64d61d2dbef0401">read_ids</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> thrust::device_vector&lt;position_in_read_t&gt;&amp; <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#a66e5d024befc410221610f454eff7183">positions_in_reads</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> thrust::device_vector&lt;SketchElement::DirectionOfRepresentation&gt;&amp; <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#a5824f352fd89f69c9acc14430a3aa6cd">directions_of_reads</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> std::string&amp; <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#ac59d309eeb226592a96622fec2b307fd">read_id_to_read_name</a>(<span class="keyword">const</span> read_id_t read_id) <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> thrust::device_vector&lt;representation_t&gt;&amp; <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#af44999c8852d5915d585c55a1a95c74a">unique_representations</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> thrust::device_vector&lt;std::uint32_t&gt;&amp; <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#af4f69a9003fedb9ca11665d5faa43bff">first_occurrence_of_representations</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <span class="keyword">virtual</span> <span class="keyword">const</span> std::uint32_t&amp; <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#a59186cdd6dbfd21baeb07e80bd4354d4">read_id_to_read_length</a>(<span class="keyword">const</span> read_id_t read_id) <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keyword">virtual</span> std::uint64_t <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#ac9e936ae3809c82894a22a5ddb6bb937">number_of_reads</a>() <span class="keyword">const</span> = 0;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classclaragenomics_1_1cudamapper_1_1Index.html#af9247d4b637615bf5912acc57b27b919">   77</a></span>&#160;    <span class="keyword">static</span> uint64_t <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#af9247d4b637615bf5912acc57b27b919">maximum_kmer_size</a>()</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    {</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">sizeof</span>(representation_t) * 8 / 2;</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    }</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160; </div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keyword">static</span> std::unique_ptr&lt;Index&gt;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <a class="code" href="classclaragenomics_1_1cudamapper_1_1Index.html#a47c3cb89daa4076243dd5977acfb7ccf">create_index</a>(<span class="keyword">const</span> <a class="code" href="classclaragenomics_1_1io_1_1FastaParser.html">io::FastaParser</a>&amp; parser,</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;                 <span class="keyword">const</span> read_id_t first_read_id,</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;                 <span class="keyword">const</span> read_id_t past_the_last_read_id,</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                 <span class="keyword">const</span> std::uint64_t kmer_size,</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                 <span class="keyword">const</span> std::uint64_t window_size,</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                 <span class="keyword">const</span> <span class="keywordtype">bool</span> hash_representations = <span class="keyword">true</span>);</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;};</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160; </div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;} <span class="comment">// namespace cudamapper</span></div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;} <span class="comment">// namespace claragenomics</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_a5cfe03b47850170ec64d61d2dbef0401"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#a5cfe03b47850170ec64d61d2dbef0401">claragenomics::cudamapper::Index::read_ids</a></div><div class="ttdeci">virtual const thrust::device_vector&lt; read_id_t &gt; &amp; read_ids() const =0</div><div class="ttdoc">returns an array of reads ids for sketch elements</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_a876d5e82f9fc36f481854f7d84e5fc80"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#a876d5e82f9fc36f481854f7d84e5fc80">claragenomics::cudamapper::Index::representations</a></div><div class="ttdeci">virtual const thrust::device_vector&lt; representation_t &gt; &amp; representations() const =0</div><div class="ttdoc">returns an array of representations of sketch elements</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html">claragenomics::cudamapper::Index</a></div><div class="ttdoc">Index - manages mapping of (k,w)-kmer-representation and all its occurences.</div><div class="ttdef"><b>Definition:</b> index.hpp:31</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_afcaccc9f9526d9c66280eca17ff3a4ac"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#afcaccc9f9526d9c66280eca17ff3a4ac">claragenomics::cudamapper::Index::~Index</a></div><div class="ttdeci">virtual ~Index()=default</div><div class="ttdoc">Virtual destructor.</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_ac9e936ae3809c82894a22a5ddb6bb937"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#ac9e936ae3809c82894a22a5ddb6bb937">claragenomics::cudamapper::Index::number_of_reads</a></div><div class="ttdeci">virtual std::uint64_t number_of_reads() const =0</div><div class="ttdoc">returns number of reads in input data</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_a59186cdd6dbfd21baeb07e80bd4354d4"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#a59186cdd6dbfd21baeb07e80bd4354d4">claragenomics::cudamapper::Index::read_id_to_read_length</a></div><div class="ttdeci">virtual const std::uint32_t &amp; read_id_to_read_length(const read_id_t read_id) const =0</div><div class="ttdoc">returns read length for the read with the gived read_id</div></div>
<div class="ttc" id="aclassclaragenomics_1_1io_1_1FastaParser_html"><div class="ttname"><a href="classclaragenomics_1_1io_1_1FastaParser.html">claragenomics::io::FastaParser</a></div><div class="ttdef"><b>Definition:</b> fasta_parser.hpp:31</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_ac59d309eeb226592a96622fec2b307fd"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#ac59d309eeb226592a96622fec2b307fd">claragenomics::cudamapper::Index::read_id_to_read_name</a></div><div class="ttdeci">virtual const std::string &amp; read_id_to_read_name(const read_id_t read_id) const =0</div><div class="ttdoc">returns read name of read with the given read_id</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_a66e5d024befc410221610f454eff7183"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#a66e5d024befc410221610f454eff7183">claragenomics::cudamapper::Index::positions_in_reads</a></div><div class="ttdeci">virtual const thrust::device_vector&lt; position_in_read_t &gt; &amp; positions_in_reads() const =0</div><div class="ttdoc">returns an array of starting positions of sketch elements in their reads</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_a47c3cb89daa4076243dd5977acfb7ccf"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#a47c3cb89daa4076243dd5977acfb7ccf">claragenomics::cudamapper::Index::create_index</a></div><div class="ttdeci">static std::unique_ptr&lt; Index &gt; create_index(const io::FastaParser &amp;parser, const read_id_t first_read_id, const read_id_t past_the_last_read_id, const std::uint64_t kmer_size, const std::uint64_t window_size, const bool hash_representations=true)</div><div class="ttdoc">generates a mapping of (k,w)-kmer-representation to all of its occurrences for one or more sequences</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_af9247d4b637615bf5912acc57b27b919"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#af9247d4b637615bf5912acc57b27b919">claragenomics::cudamapper::Index::maximum_kmer_size</a></div><div class="ttdeci">static uint64_t maximum_kmer_size()</div><div class="ttdoc">Return the maximum kmer length allowable.</div><div class="ttdef"><b>Definition:</b> index.hpp:77</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_a5824f352fd89f69c9acc14430a3aa6cd"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#a5824f352fd89f69c9acc14430a3aa6cd">claragenomics::cudamapper::Index::directions_of_reads</a></div><div class="ttdeci">virtual const thrust::device_vector&lt; SketchElement::DirectionOfRepresentation &gt; &amp; directions_of_reads() const =0</div><div class="ttdoc">returns an array of directions in which sketch elements were read</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_af44999c8852d5915d585c55a1a95c74a"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#af44999c8852d5915d585c55a1a95c74a">claragenomics::cudamapper::Index::unique_representations</a></div><div class="ttdeci">virtual const thrust::device_vector&lt; representation_t &gt; &amp; unique_representations() const =0</div><div class="ttdoc">returns an array where each representation is recorder only once, sorted by representation</div></div>
<div class="ttc" id="aclassclaragenomics_1_1cudamapper_1_1Index_html_af4f69a9003fedb9ca11665d5faa43bff"><div class="ttname"><a href="classclaragenomics_1_1cudamapper_1_1Index.html#af4f69a9003fedb9ca11665d5faa43bff">claragenomics::cudamapper::Index::first_occurrence_of_representations</a></div><div class="ttdeci">virtual const thrust::device_vector&lt; std::uint32_t &gt; &amp; first_occurrence_of_representations() const =0</div><div class="ttdoc">returns first occurrence of corresponding representation from unique_representations() in data arrays</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
